package com.lzw.breezeNovel.model.enums.message;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.model.enums.message
 * @date 2025/3/28
 * @description 消息状态的枚举类
 */
@SuppressWarnings("all")
public enum MessageStatus {
    UNREAD(0,"未读"),
    READ(1,"已读"),
    DELETED(2,"已删除");

    private Integer code;

    private String desc;

    MessageStatus(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    /**
     * 根据code获取枚举
     */
    public static String getEnumByCode(Integer code) {
       for (MessageStatus status : MessageStatus.values()) {
          if (status.code.equals(code)) {
             return status.desc;
          }
       }
       return null;
    }

}
